/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.applicatioN.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Slim
 */
@Embeddable
public class EtudierPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "SPECIALITE")
    private String specialite;
    @Basic(optional = false)
    @Column(name = "IDENTIFIANT")
    private int identifiant;
    @Basic(optional = false)
    @Column(name = "NOM")
    private String nom;

    public EtudierPK() {
    }

    public EtudierPK(String specialite, int identifiant, String nom) {
        this.specialite = specialite;
        this.identifiant = identifiant;
        this.nom = nom;
    }

    public String getSpecialite() {
        return specialite;
    }

    public void setSpecialite(String specialite) {
        this.specialite = specialite;
    }

    public int getIdentifiant() {
        return identifiant;
    }

    public void setIdentifiant(int identifiant) {
        this.identifiant = identifiant;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (specialite != null ? specialite.hashCode() : 0);
        hash += (int) identifiant;
        hash += (nom != null ? nom.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EtudierPK)) {
            return false;
        }
        EtudierPK other = (EtudierPK) object;
        if ((this.specialite == null && other.specialite != null) || (this.specialite != null && !this.specialite.equals(other.specialite))) {
            return false;
        }
        if (this.identifiant != other.identifiant) {
            return false;
        }
        if ((this.nom == null && other.nom != null) || (this.nom != null && !this.nom.equals(other.nom))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.applicatioN.entities.EtudierPK[ specialite=" + specialite + ", identifiant=" + identifiant + ", nom=" + nom + " ]";
    }
    
}
